/* Copyright (c) 2016-2020 Enfry Ltd. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Enfry. 
 * You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Enfry.
 */
package com.enfry.common.util.control;

import com.enfry.common.util.validate.Validates;

/**
 * 
 * <请简单说明此类用途>
 * 
 * @Title com.enfry.util.control.Eventee
 * @author Penghu
 * @date 2018年1月10日
 */
public class FilterEndsWith implements Filter {
	private String endsWith;

	@Override
	public Filter param(Object param) {
		this.endsWith = (String) param;
		return this;
	}

	@Override
	public boolean access(Object match) {
		String name = (String) match;
		return Validates.isEmpty(endsWith) || name.endsWith(endsWith);
	}
}
